﻿/********************************************************************************
** @ Date:2025/07/11
** @ Author: Gaojia
** @ Description: 自定义图标带文字按钮
** @ Version:1.0.0
** @ Fun:
********************************************************************************/
#ifndef MyToolButton_H
#define MyToolButton_H
#include <qtoolbutton.h>
#include "CBaseNode.h"
#include "CBaseDevice.h"
class MyToolButton :public QToolButton
{
	Q_OBJECT
public:
	explicit MyToolButton(CBaseNode *pNode, QButtonGroup *pGroup, QWidget *parent = nullptr);
	~MyToolButton();
	void mouseDoubleClickEvent(QMouseEvent *event) override;
	void mousePressEvent(QMouseEvent *event) override;
private:
	void initUi();   //初始化图标按钮
public slots:
	void showContextMenu(const QPoint &pos);
signals:
	void sign_clicked(CBaseNode *pNode);
	void sign_doubleClicked(CBaseNode *pNode);
	void sign_Delete(CBaseNode* pNode);
private:
	CBaseNode *m_pNode;
};

#endif